//
//  FNBannerCollectionViewBaseCell.swift
//  FNBanner
//
//  Created by Fnoz on 2016/10/26.
//  Copyright © 2016年 Fnoz. All rights reserved.
//

import UIKit
import Kingfisher

class FNBannerCollectionViewBaseCell: UICollectionViewCell {
    var bannerImageView = UIImageView.init(frame: CGRect.zero)
    
    func loadImageUrl(imageUrl:String? = nil, placeHolder:UIImage? = nil) {
        if (imageUrl?.hasPrefix("http") == true) {
            bannerImageView.kf.setImage(with: URL(string:imageUrl!), placeholder: placeHolder, options: [.transition(ImageTransition.fade(0.5))], progressBlock: nil, completionHandler: nil)
        } else {
            bannerImageView.image = UIImage(named: imageUrl!)
        }
    }
}
